package Demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-10
 * Time: 18:25
 */
public class Test {
    public static void fun(Object obj){//发生向上转型
        if(obj instanceof String str){
            //...
        }
    }

    public static void main(String[] args) {
        fun(new String("hello"));
    }
}
